home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9368 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: gail.ripco.com!mambuhl
  2. From: mambuhl@ripco.com (Martin Ambuhl)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: help: gcc
  5. Date: 9 Mar 1996 18:51:58 GMT
  6. Organization: Ripco Communications, Inc.
  7. Message-ID: <4hsk0e$j8f@gail.ripco.com>
  8. NNTP-Posting-Host: foley.ripco.com
  9.  
  10. spiffy@seas.gwu.edu (Marc Goldberg) in
  11. <4hpiht$1n2@cronkite.seas.gwu.edu> asks:
  12.  
  13.  
  14. >2FarmCheck.c: In function `readHostFiles':
  15. >2FarmCheck.c:23: dereferencing pointer to incomplete type
  16. [etc.]
  17.  
  18. >The lines referred to are:
  19.  
  20. >char *readHostFiles(char *name)
  21. >      {
  22. >      int foo;
  23. >      struct FILE *fileDisc;
  24.        ^^^^^^
  25.       Lose this.
  26.  
  27. >(23)  *fileDisc = fopen("/users/spiffy/urls.txt", O_RDONLY);
  28. [etc.]
  29.  
  30. Just so you know (from ISO 7.9.1):
  31.      "The types declared as size_t (described in 7.1.6):
  32.      FILE
  33.      which is an object type capable of recording all the information
  34.      needed to control a stream,..."
  35. Note that the type of the object to which fileDisc should point is
  36. `FILE', not `struct FILE'.
  37.  
  38. stdio.h will typically have something like
  39. typedef struct /* some structure tag */ {
  40.         /* the structure members */
  41.         } FILE;
  42.  
  43. ... and the subject line is wrong.  This has nothing to do with gcc,
  44. except that gcc can be a C compiler.
  45.  
  46.                                                                
  47. --
  48. * Martin Ambuhl       net: mambuhl@ripco.com
  49. * Chicago, IL (USA)    
  50.